'use strict';

module.exports = function (mongoose, Schema) {

    let schema = new Schema({
        title: String,
        type: Number,
        releaseDate: Number,
        summary: String,
        author: {
            $type: String,
            //default: "涂广炳"
        },
        eCode: String,
        stockName: String,
        readNum: {
            $type: Number,
            default: 0
        },
        readNumFalse: {
            $type: Number,
            default: 0
        },
        voice: String,
        voiceAuth: String, // userId
        image: String,
        highlight: String, // 需要高亮的股票名字  format: sh6425561/股票名,sz5125/股票名
        color: String, // 高亮的颜色
        strong: Number
    }, {collection: 'fast_info', typeKey: '$type'});

    schema.index({createdAt: -1});
    schema.index({eCode: 1, type: 1});

    return mongoose.model('FastInfo', schema);
};

